//
//  subscriptTest.cpp
//  learnC++
//
//  Created by liuzhibing on 2018/6/5.
//  Copyright © 2018年 yunfan.com. All rights reserved.
//

#include "subscriptTest.hpp"

char &GradeMap::operator[](const std::string &name){
    
    for(auto &element : m_map){
        if (element.name == name) {
            return element.grade;
        }
    }
    
    StudentGrade temp {name,' '};
    m_map.push_back(temp);
    return m_map.back().grade;
}
